package com.hanamaki.method;

import java.util.Arrays;
import java.util.Scanner;

public class Demo09 {

    public static void main(String[] args) {


        // 7+8
        System.out.println("请输入计算公式：");
        Scanner scanner = new Scanner(System.in);

        String express = scanner.next();
//        System.out.println(express);

//        String[] strings = express.split("/+/");// 在Java中  可以使用转义字符

        int i = express.indexOf("+");
//        System.out.println("定位："+i);

        String left = express.substring(0, i);
//        System.out.println(left);

        String right = express.substring(i + 1);
//        System.out.println(right);

        /* 计算结果*/
        System.out.println("两数之和为：" + ((Integer.parseInt(left)) + Integer.parseInt(right)));

        // 1545+456*899/90

    }
}
